<template>
  <loading  ref="refRoading" :check_loading="check_loading"></loading>
  <router-view></router-view>
</template>

<script>
import loading from "./components/loading.vue";
export default {
  name: "App",
  components: {
    loading,
  },
  methods: {
    check_loading() {
      let timer = setInterval(() => {
        if (document.readyState == "complete") {
          clearInterval(timer);
          this.$refs.refRoading.out();
        }
      },300);
    },
  },
  mounted() {
    // this.check_loading();
    this.$router.beforeEach((to, from, next) => {
        this.$refs.refRoading.In(next);
       
    });
  
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>
